Skip to content

tooling: Consolidate configuration in pyproject.toml.#227

Merged
nedseb merged 3 commits intomainfrom
tooling/consolidate-pyproject
Mar 24, 2026
Merged

tooling: Consolidate configuration in pyproject.toml.#227
nedseb merged 3 commits intomainfrom
tooling/consolidate-pyproject

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 24, 2026

Summary

Closes #226

Centralizes project configuration in pyproject.toml and cleans up redundant files.

Changes

Commit 1: Consolidate configuration

  • Migrate pytest config: pytest.ini[tool.pytest.ini_options] in pyproject.toml, delete pytest.ini
  • Add project metadata: [project] section with name, version, description, license, urls
  • Enable isort in ruff: Add "I" to ruff select, remove [tool.isort] section
  • Cleanup: Remove duplicate # "T20" comment, reorganize select list, add comments on ignore rules
  • Add [tool.ruff.lint.isort]: Configure known-third-party for micropython

Commit 2: Apply isort ordering

  • Auto-fix 68 import ordering violations across 67 files via ruff check --fix --select I001
  • No functional changes — only import order

Checklist

  • ruff check passes
  • pytest tests/ -k mock passes (164 passed)
  • Tested on hardware (if applicable)
  • README updated (if adding/changing public API)
  • Examples added/updated (if applicable)
  • Commit messages follow <scope>: <Description.> format

Copilot AI review requested due to automatic review settings March 24, 2026 05:37
@nedseb nedseb added the ci CI/CD, workflows, linting label Mar 24, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Centralizes Python tooling configuration into pyproject.toml (pytest + ruff/isort) and applies repository-wide import sorting via Ruff’s isort rules, reducing standalone config files and keeping linting consistent.

Changes:

  • Move pytest.ini settings into [tool.pytest.ini_options] in pyproject.toml and delete pytest.ini.
  • Enable Ruff’s isort (I) rules and add Ruff isort configuration for MicroPython imports.
  • Auto-fix import ordering across tests, libraries, and examples.

Reviewed changes

Copilot reviewed 69 out of 69 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Adds [project] metadata; migrates pytest config; enables Ruff isort and updates lint config/comments.
pytest.ini Removes legacy pytest config file.
tests/conftest.py Import ordering only.
tests/test_scenarios.py Import ordering only.
tests/runner/executor.py Import ordering/grouping (including within function).
lib/wsen-pads/wsen_pads/device.py Import ordering only.
lib/wsen-pads/examples/test.py Import ordering only.
lib/wsen-pads/examples/one_shot_reader.py Import ordering only.
lib/wsen-pads/examples/continuous_reader.py Import ordering only.
lib/wsen-pads/examples/basic_reader.py Import ordering only.
lib/wsen-pads/examples/altitude.py Import ordering only.
lib/wsen-hids/wsen_hids/device.py Import ordering only.
lib/wsen-hids/examples/one_shot_mode.py Import ordering only.
lib/wsen-hids/examples/full_test.py Import ordering only.
lib/wsen-hids/examples/continuous_mode.py Import ordering only.
lib/vl53l1x/examples/distance.py Import ordering only.
lib/steami_config/steami_config/device.py Whitespace cleanup near imports.
lib/steami_config/examples/show_config.py Import ordering only.
lib/steami_config/examples/calibrate_temperature.py Import ordering only.
lib/ssd1327/ssd1327/device.py Import ordering/blank line placement.
lib/ssd1327/examples/shades.py Import spacing cleanup.
lib/ssd1327/examples/rotation.py Import ordering only.
lib/ssd1327/examples/rotating_3d_cube.py Import ordering only.
lib/ssd1327/examples/random_pixels.py Import spacing cleanup.
lib/ssd1327/examples/micropython_logo.py Import spacing cleanup.
lib/ssd1327/examples/lookup_table.py Import ordering only.
lib/ssd1327/examples/invert.py Import ordering only.
lib/ssd1327/examples/illusion.py Import spacing cleanup.
lib/ssd1327/examples/hello_world.py Import spacing cleanup.
lib/ssd1327/examples/framebuf_text.py Import spacing cleanup.
lib/ssd1327/examples/framebuf_scroll.py Import ordering only.
lib/ssd1327/examples/framebuf_rects.py Import spacing cleanup.
lib/ssd1327/examples/framebuf_pixels.py Import ordering only.
lib/ssd1327/examples/framebuf_lines.py Import ordering only.
lib/ssd1327/examples/bitmap.py Import spacing cleanup.
lib/mcp23009e/mcp23009e/pin.py Import spacing cleanup.
lib/mcp23009e/mcp23009e/device.py Import ordering/spacing cleanup.
lib/mcp23009e/mcp23009e/__init__.py Import ordering only.
lib/mcp23009e/examples/test_pin_irq.py Import ordering only.
lib/mcp23009e/examples/test_pin.py Import ordering only.
lib/mcp23009e/examples/test_output_active_low.py Import ordering only.
lib/mcp23009e/examples/test_output.py Import ordering only.
lib/mcp23009e/examples/test_led_simple.py Import ordering only.
lib/mcp23009e/examples/test_interrupts.py Import ordering only.
lib/mcp23009e/examples/test_basic.py Import ordering only.
lib/mcp23009e/examples/i2c_scan.py Import formatting (I2C, Pin) and spacing.
lib/mcp23009e/examples/buttons.py Import ordering only.
lib/lis2mdl/lis2mdl/device.py Import ordering only.
lib/lis2mdl/examples/magnet_test.py Import ordering only.
lib/lis2mdl/examples/magnet_fieldForce.py Import ordering only.
lib/lis2mdl/examples/magnet_compass.py Import ordering only.
lib/ism330dl/ism330dl/__init__.py Import ordering only.
lib/ism330dl/examples/static_orientation.py Import ordering only.
lib/ism330dl/examples/motion_orientation.py Import ordering only.
lib/ism330dl/examples/basic_read.py Import ordering only.
lib/hts221/hts221/device.py Import ordering/spacing cleanup.
lib/hts221/examples/humidity.py Import ordering only.
lib/daplink_flash/examples/write_csv.py Import ordering only.
lib/daplink_flash/examples/sensor_log.py Import ordering only.
lib/daplink_flash/examples/read_file.py Import ordering only.
lib/daplink_flash/examples/flash_info.py Import ordering only.
lib/daplink_flash/examples/erase_flash.py Import ordering only.
lib/daplink_flash/examples/config_zone.py Import ordering/spacing cleanup.
lib/bq27441/examples/fuel_gauge.py Import ordering only.
lib/bq27441/bq27441/device.py Import ordering/grouping cleanup.
lib/apds9960/examples/proximity.py Import ordering only.
lib/apds9960/examples/gesture.py Import ordering only (including from ... import (...) name order).
lib/apds9960/examples/ambient_light.py Import ordering only.
lib/apds9960/apds9960/device.py Import ordering/spacing cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment on lines +2 to +6
name = "micropython-steami-lib"
version = "0.1.0"
description = "MicroPython driver library for the STeaMi board."
license = {text = "MIT"}
requires-python = ">=3.7"
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[project].license is set to MIT, but the repository LICENSE file (and README) indicate GPL v3. This makes the central metadata incorrect and could mislead tooling/compliance checks. Update the license field to match the repo’s actual license (e.g., reference the LICENSE file or use a GPL v3 identifier).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ed8b79f. Changed to GPL-3.0-or-later to match the LICENSE file.

Comment thread pyproject.toml
Comment on lines +14 to +18
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"mock: tests using FakeI2C (no hardware needed)",
"hardware: tests requiring a real board (use --port)",
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The marker definitions here overlap with (and differ from) the marker registration done in tests/conftest.py (which also defines a board marker). To keep configuration centralized and avoid drift, consider making pyproject.toml the single source of truth (include all markers such as board, and/or remove duplicate config.addinivalue_line(...) marker registrations).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ed8b79f. Added the missing board marker to pyproject.toml and removed the duplicate pytest_configure() marker registrations from conftest.py. pyproject.toml is now the single source of truth for markers.

@nedseb nedseb merged commit abcb813 into main Mar 24, 2026
3 checks passed
@nedseb nedseb deleted the tooling/consolidate-pyproject branch March 24, 2026 05:45
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD, workflows, linting released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tooling: Consolidate project configuration in pyproject.toml.

2 participants